/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modeladesktop.graficas;

import org.jfree.data.DomainOrder;
import org.jfree.data.general.AbstractSeriesDataset;
import org.jfree.data.xy.XYDataset;
import umontreal.iro.lecuyer.probdist.StudentDist;

/**
 *
 * @author Alvaro
 *
 * Estado: Completo
 *
 */
public class TestTDataSet extends AbstractSeriesDataset implements XYDataset {

    private int freedom1;
    private int seriescount;
    private double ttabla;
    private double tcalculado;

    public TestTDataSet(int freedom1, double ttablaX, double tcalculadoX){
        this.freedom1=freedom1;
        this.ttabla=ttablaX;
        this.tcalculado=tcalculadoX;
        seriescount=4;
    }

    @Override
    public int getSeriesCount() {
        return seriescount;
    }

    @Override
    public Comparable getSeriesKey(int i) {
        switch(i){
            case 0:
                return "Y = T(x)";
            case 1:
                return "TCalculada";
            case 2:
                return "+TTabla";
        }
        return "-TTabla";
    }

    public DomainOrder getDomainOrder() {
        return DomainOrder.NONE;
    }

    public int getItemCount(int i) {
        return 100;
    }

    public Number getX(int i, int i1) {
        switch(i){
            case 0:
                return new Double(-5.0 + i1 / 10.0);
            case 1:
                return tcalculado;
            case 2:
                return ttabla;
        }
        return -ttabla;
    }

    public double getXValue(int i, int i1) {
        switch(i){
            case 0:
                return -5.0 + i1 / 10.0;
            case 1:
                return tcalculado;
            case 2:
                return ttabla;
        }
        return -ttabla;
    }

    public Number getY(int i, int i1) {
        return StudentDist.density(freedom1, -5.0 + i1 / 10.0);
    }

    public double getYValue(int i, int i1) {
        return StudentDist.density(freedom1, -5.0 + i1 / 10.0);
    }

}
